package net.adetech.crj.service;


import net.adetech.crj.dao.HallMapper;
import net.adetech.crj.entity.Hall;
import net.adetech.crj.utils.InnerServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service("hall.getListByServiceType")
public class GetHallListByServiceTypeService implements BaseService {
    @Autowired
    HallMapper hallMapper;

    @Override
    public Map<String, Object> invoke(Map<String, Object> params) {
        String serviceType = (String) params.get("serviceType");
        List<Hall> hallList = new ArrayList<Hall>();
        if ("A".equals(serviceType)) {
            hallList = hallMapper.getHallListType1();
        } else if ("B".equals(serviceType)) {
            hallList = hallMapper.getHallListType2();
        } else if ("C".equals(serviceType)) {
            hallList = hallMapper.getHallListType3();
        }
        return InnerServiceUtil.buildResult("hallList", hallList);
    }
}
